/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bpt_projects;

//import java.util.List;
//import org.hibernate.Session;
//import org.hibernate.SessionFactory;
//import utils.HibernateUtil;

public class BPT_Projects {

    /**
     * @param args the command line arguments
     */
//    public static void main(String[] args) {
//        // Demo retrive data from database using hibernate version 4.1
//
//        // Step 01 : get configurations and create session factory.
//        SessionFactory _sessionFactory = HibernateUtil.getSessionFactory();
//        try {
//            // Step 02 : create query session.
//            Session querySession = _sessionFactory.openSession();
//            // Step 03 : begin query session.
//            querySession.beginTransaction();
//            // Step 04 : prepare query and fetch data from database
//            String _spLoginUser = "FROM Phongchieu";
//            List rooms = querySession.createQuery(_spLoginUser).list();
//            System.out.println(String.format("Nums records : %s", rooms.size()));
//            // Step 05 :
//            querySession.getTransaction().commit();
//            // Step 06 :
//            querySession.close();
//        } catch (Exception e) {
//             System.out.println(String.format("error : {0}", e.getMessage()));
//        }
//    }
}
